/**
 * 操作权限处理
 */
export default function MyPermissions({ authority, children }) {
	const { permissions } = useSelector((store) => store.base);
	return <>{permissions.some((itm) => ('*:*:*' === itm || isArray(authority) ? authority.includes(itm) : authority === itm)) && children}</>;
}

MyPermissions.propTypes = {
	authority: propTypes.oneOfType([propTypes.array, propTypes.string]).isRequired
};
